// 详情用法请参考：https://www.uviewui.com/js/http.html
//const http = uni.$u.http

import { config } from "process"

// post请求，获取菜单
//export const postShopInfo = (params, config = {}) => http.post('/edcapi/Shop_shopDeatil', params, config)
// get请求，获取菜单，注意：get请求的配置等，都在第二个参数中，详见前面解释
//export const getShopInfo = (data) => http.get('/edcapi/Shop_shopDeatil', data)
// 初始化请求配置
// uni.$u.http.setConfig((config) => {
// 	config.baseURL = 'https://sp.release.60kongjian.top/api/'; /* 根域名 */
// 	console.log(config);
// 	return config
// })

const http = uni.$u.http
let api = {}
console.log(api,`api`)
//首页接口
api.getIndex = (params) => http.get('/api/home/index', params)
//首页 旅居
api.getHomeSojourn = (params) => http.get('/api/home/sojourn', params)
//首页 线路
api.getHomeLine = (params) => http.get('/api/home/line', params)
//旅居列表 
api.getSojournList = (params) => http.get('/api/sojourn/list', params)
//线路列表
api.getLineList = (params) => http.get('/api/line/list', params)
//出境游列表
api.getjingwaiList = (params) => http.get('/api/line/list?pro_type=6', params)
//基地列表
api.getQaedaList = (params) => http.get('/api/qaeda/list', params)

//获取产品列表tab值
api.getTabcount = (params) => http.get('/api/line/count', params)

// 获取产品列表筛选项 http://xcx.llkj.wang/api/home/get_product_label_data?type=50&proType=
api.getProductLabel = (params) => http.get('/api/home/get_product_label_data', params)
// 获取搜索页数据 api/home/get_search_data
api.getSearchData = (params) => http.get('/api/home/get_search_data', params)

// 搜索更多推荐   
api.getAllHotProduct = (params) => http.get('/api/home/get_all_hot_product', params)
// 搜索结果
api.getSearchProduct = (params) => http.get('/api/home/search_product', params)


//基地地区列表
api.getQaedaArea = (params) => http.get('/api/qaeda/area', params)
//线路详情
api.getLineDetail = (params = {params:{id:42}}) => http.get('/api/line/detail', params)
//线路团期
api.getLineGroup = (params = {params:{meal_id:23,month:"2022-08"}}) => http.get('/api/line/group', params)
//线路月份起始价
api.getLineMonthPrice = (params = {params:{meal_id:23}}) => http.get('/api/line/month/price', params)
//获取价格配置
api.getLinePriceConfig = (params = {params:{group_id:23}}) => http.get('/api/line/price/config', params)
//旅居详情
api.getSojournDetail = (params = {params:{id:1}}) => http.get('/api/sojourn/detail', params)
//旅居团期 
api.getSojournGroup = (params = {params:{meal_id:1,month:"2022-08"}}) => http.get('/api/sojourn/group', params)
//旅居月份起始价
api.getlvjuMonthPrice = (params = {params:{meal_id:23}}) => http.get('/api/sojourn/month/price', params)
//基地月份起始价
api.getbaseMonthPrice = (params = {params:{meal_id:26}}) => http.get('/api/qaeda/month/price', params)
//旅居下单
api.getlvjuOrderCreate = (params = {}) => http.post('/api/sojourn/order/create', params)
//旅居保险费
// api.getlvjuInsurance = (params = {}) => http.get('sojourn/insurance', params)
//基地详情
api.getQaedaDetail = (params = {params:{id:7}}) => http.get('/api/qaeda/detail', params)
//线路 - 获取出行人信息
api.getLineTraveler = (params = {params:{}}) => http.get('/api/line/traveler', params)
//线路 - 补全出行人信息
api.getLineTravelerSave = (params = {}) => http.post('/api/line/traveler/save', params)
//线路 -创建订单和支付
api.getLineOrderCreate = (params = {}) => http.post('/api/line/order/create', params)
//基地 -创建订单和支付
api.getbaseOrderCreate = (params = {}) => http.post('/api/qaeda/order/create', params)
//旅居 -创建订单和支付
api.getLvjuOrderCreate = (params = {}) => http.post('/api/sojourn/order/create', params)
//我的 - 个人中心
api.getUserIndex = (params = {}) => http.get('/api/user/index', params)
//订单列表 status 订单状态 1 待收款 2 待出行 3出行中 4出行完成 5已取消
api.getOrderList = (params = {params:{status:1}}) => http.get('/api/order/list', params)
//取消订单  type订单类型：50线路，51基地，52旅居
api.getOrderCancel = (params = {params:{order_id:7,type:52}}) => http.get('/api/order/cancel', params)
//出行订单支付
api.getOrderPay = (params = {params:{order_id:7,type:52}}) => http.get('/api/order/pay', params)
//出行订单详情
api.getOrderDetail = (params = {params:{order_id:7,type:52}}) => http.get('/api/order/detail', params)
//出行订单合同链接 /api/order/get/contract-info?contract_num=453534534
api.getOrderContractInfo = (params = {params:{}}) => http.get('/api/order/get/contract-info', params)
//出行订单删除
api.getOrderDelete = (params = {params:{order_id:7,type:52}}) => http.get('/api/order/delete', params)
//旅居计划
api.getHomePlaning = (params = {}) => http.get('/api/home/planing', params)
//旅居卡激活
api.cardActivation = (params = {}) => http.post('/api/card/activate', params)
// 修改个人信息
api.setUserInfo = (params) => {
    return http.post('/api/user/information/save', params)
}
// 退款
api.refund = (params) => {
    return http.post('/api/refund', params)
}
//退款详情

// 退款订单列表
api.refundList = (params) => {
    return http.get(`/api/refund/detail?refund_id=${params.refund_id}&type=${params.type}`)
}
// 退款列表
api.MyRefundList = (params) => {
    return http.get(`/api/refund/list`,params)
}
// 撤销退款
api.cancel = (params) => {
    return http.get(`/api/refund/cancel?refund_id=${params.refund_id}&type=${params.type}`)
}
// 删除退款
api.delete = (params) => {
    return http.get(`/api/refund/delete?refund_id=${params.refund_id}&type=${params.type}`)
}
// 获取个人信息
api.getUser = (params) => {
    return http.get('/api/user/information', params)
}
// 心愿单
// api.getList = (params = {}) => http.get('user/wish/list', params)
api.getList = (params) => {
    return http.get('/api/user/wish/list?type='+params.type)
}
// 删除心愿单
api.del = (params) => {
    return http.get('/api/user/wish/del?id='+params)
}

// 基地 - 团期
api.getOnline = (params) => {
    return http.get(`/api/qaeda/group`,params)
}
// 基地下单获取价格详情
api.getJiDiAmount = (params) => {
    return http.post('/api/qaeda/amount/detail', params)
}
// 添加心愿单
api.add = (params = {}) => http.post('/api/user/wish/save', params)
//地址列表
api.getAddrList = (params = {}) => http.get('/api/user/addr/list', params)
//编辑地址 添加地址
api.postAddrSave = (params = {}) => http.post('/api/user/addr/save', params)
//地址详情
api.getAddrDetail = (params = {}) => http.get('/api/user/addr/detail', params)
//地址设置默认
api.getAddrDefault = (params = {}) => http.get('/api/user/addr/default', params)
//我的家人删除
//我的家人编辑和添加
api.postFamilySave = (params = {}) => http.post('/api/user/family/save', params)
//旅居卡详情
api.getCardDetail = (params = {}) => http.get('/api/card/detail', params)
//旅居卡下单
api.postCardOrder = (params = {}) => http.post('/api/card/order', params)
//旅居卡订单列表
api.getCardOrderList = (params = {}) => http.get('/api/card/order/list', params)
//旅居卡订单-再次支付
api.getCardPayAgain = (params = {}) => http.get('/api/card/pay/again', params)
//旅居卡订单-取消
api.getCardOrderCancel = (params = {}) => http.get('/api/card/order/cancel', params)
//旅居卡订单-详情
api.getCardOrderDetail = (params = {}) => http.get('/api/card/order/detail', params)
//旅居卡订单-确认收货
api.getCardOrderReceipt = (params = {}) => http.get('/api/card/order/confirm/receipt', params)
//优惠券 详情
api.getCouponDetail = (params = {}) => http.get('/api/coupon/detail', params)
//优惠券 订单列表
api.getCouponOrderList = (params = {}) => http.get('/api/user/coupon/list', params)
//优惠券 下订单
api.postCouponPayOrder = (params = {}) => http.post('/api/coupon/pay/order', params)
//免费领取优惠券 coupon/receive?coupon_id=55
api.getCouponReceive = (params = {}) => http.get('/api//coupon/receive', params)
//优惠券 列表
api.getCouponList = (params = {}) => http.get('/api/coupon/list', params)
//获取可用的优惠券 列表
api.getCouponAvailable = (params = {}) => http.get('/api/user/coupon/available', params)
//合并账号
api.postAuthMerge = (params = {}) => http.post('/api/auth/merge', params)
//直播列表
api.getliveinfo = (params = {}) => http.get('/api/getinfo/getliveinfo', params)

//基地是否显示预定和咨询
api.reserveMethod = (params = {}) => http.get('/api/qaeda/get/reserveMethod', params)
//获取直播二维码
api.getLiveCode = (params = {}) => http.get('/api/share/live/code', params)
//获取产品详情页二维码
api.getDetailCode = (params = {}) => http.get('/api/share/detail/code', params)
//获取积分明细
api.getIntegralList = (params = {}) => http.get('/api/user/integral/list', params)
//获取辛福豆明细
api.getXingfudouList = (params = {}) => http.get('/api/user/xingfudou/list', params)
//首次分享获取积分
api.getIntegralshare = (params = {}) => http.get('/api/integral/first/share', params)
//获取积分任务
api.getIntegraltask = (params = {}) => http.get('/api/integral/task', params)
//我的卡包及权限
api.getInfoCard = (params = {}) => http.get('/api/user/get/card/info', params)
//领取新人礼包
api.getReceive = (params = {}) => http.get('/api/activity/receive', params)
//绑定关系
api.getAddReceive = (params = {}) => http.get('/api/activity/invite/add', params)
// 获取我的团队列表
api.MyTeam = (params = {params:{}}) => http.get('/api/activity/invite/list', params)
// 获取活动海报
api.Activityposter = (params = {params:{}}) => http.get('/api/activity/invite/code', params)
// 获取积分兑换优惠券列表
api.integralCouponList = (params = {params:{}}) => http.get('/api/integral/coupon/list', params)
// 积分兑换优惠券
api.integralExchange = (params = {params:{}}) => http.get('/api/coupon/exchange', params)

//设置所在城市 参数city = 西安市
api.getHomeLocationSet = (params = {params:{}}) => http.get('/api/home/location/set', params)



//activity 活动页面
api.getActivityTideDetail = (params = {params:{}}) => http.get('/api/activity/tide/detail', params)       //老年大学
api.getActivitySojournDetail = (params = {params:{}}) => http.get('/api/activity/sojourn/detail', params) //旅居平台落地页
api.postActivityTideOrder = (params = {}) => http.post('/api/activity/tide/order', params)


//三条线路下单
api.getLineValueaddList = (params = {params:{}}) => http.get('/api/line/get/valueadd/list', params)  //线路增值服务
api.getSojournValueaddList = (params = {params:{}}) => http.get('/api/sojourn/get/valueadd/list', params)  //旅居增值服务
api.getBaseValueaddList = (params = {params:{}}) => http.get('/api/qaeda/get/valueadd/list', params)  //及得增值服务
api.getAmount = (params) => { return http.post('/api/line/amount/detail', params) }        // 获取线路下单价格
api.getLvjuAmount = (params) => { return http.post('/api/sojourn/amount/detail', params)}  // 获取旅居下单价格


//公共接口
//获取用户可用的幸福豆和优惠券  ?customer_id=697716&product_id=48&type=50
api.getUserDiscountAvailable = (params = {params:{}}) => http.get('/api//user/get/discount/available', params)  
api.setTravelers = (params) => { return http.post('/api/user/family/save', params) } // 添加出行人
api.getFamilyList = (params = {}) => http.get('/api/user/family/list', params) //我的家人列表

//直播间订单
api.getUserCouponOrderList = (params = {}) => http.get('/api/user/coupon/order/list', params) //列表
api.getUserCouponOrderRefundList = (params = {}) => http.get('/api/user/coupon/order/get/refund/list', params) //退款订单列表
api.postUserCouponOrderActionRefund = (params = {}) => http.post('/api/user/coupon/order/action/refund', params) //申请退款
api.getUserCouponOrderActionRefundCancel = (params = {}) => http.get('/api/user/coupon/order/action/refund/cancel', params) //撤销退款
api.getUserCouponOrderActionRefundDetail = (params = {}) => http.get('/api/user/coupon/order/get/refund/detail', params) //退款列表
api.postAddBank = (params = {}) => http.post('/api/user/action/add/bank', params) //添加银行卡

//管家工作台
api.getcheckreturnsignadd = (params = {}) => http.get('/api/checkreturn/signadd', params)  //签到页面
api.getcheckreturnJourneyinfo = (params = {}) => http.get('/api/checkreturn/journeyinfo', params)  //我的行程


// 绑定分享关系
api.getBindingRelationship=  (params) => {
    return http.get('/api/activity/belong/relation',{
		params:{
			...params
		},
        ...config
    })
}
// 商品详情弹幕

api.getCustomerList=  (params) => {
    return http.get('/api/customer/list',{
		params:{
			...params
		},
        ...config
    })
}
// 配置优惠券id
api.getConfigcoupen=  (params) => {
    return http.get('api/common/get/config',{
	
    })
}

// 设为紧急联系人
api.setEmergencyContact = (id) => http.get('api/user/action/set-emergency-contact?relation_customer_id='+id) 

api.cancelEmergencyContract = (id) => http.get('api/user/action/cancel-emergency-contract?relation_customer_id='+id) 

// 落地页
api.getMarketingTopic = (id) => http.get('api/home/get_marketing_topic_detail?id='+id) 
export default api
